package com.thoughtworks.mail;

import com.thoughtworks.utils.ArrayHelper;

public class Mail {
    private long noteId;
    private String sender;
    private String[] receivers;
    private String[] copyTo;
    private String[] blindCopyTo;
    private String subject;
    private String body;
    private String[] attachments;
    private String postedDate;

    public Mail() {
    }

    public long getNoteId() {
        return noteId;
    }

    public void setNoteId(long noteId) {
        this.noteId = noteId;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String[] getReceivers() {
        return receivers;
    }

    public void setReceivers(String[] receivers) {
        this.receivers = receivers;
    }

    public String[] getCopyTo() {
        return copyTo;
    }

    public void setCopyTo(String[] copyTo) {
        this.copyTo = copyTo;
    }

    public String[] getBlindCopyTo() {
        return blindCopyTo;
    }

    public void setBlindCopyTo(String[] blindCopyTo) {
        this.blindCopyTo = blindCopyTo;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String[] getAttachments() {
        return attachments;
    }

    public void setAttachments(String[] attachments) {
        this.attachments = attachments;
    }

    public String getPostedDate() {
        return postedDate;
    }

    public void setPostedDate(String postedDate) {
        this.postedDate = postedDate;
    }

    @Override
    public String toString() {
        String SEPERATOR = "\n-------\n";
        StringBuffer sb = new StringBuffer(SEPERATOR);
        sb.append(this.noteId);
        sb.append(SEPERATOR);
        sb.append(this.sender);
        sb.append(SEPERATOR);
        sb.append(ArrayHelper.parseArrayToString(this.receivers));
        sb.append(SEPERATOR);
        sb.append(ArrayHelper.parseArrayToString(this.copyTo));
        sb.append(SEPERATOR);
        sb.append(ArrayHelper.parseArrayToString(this.blindCopyTo));
        sb.append(SEPERATOR);
        sb.append(this.subject);
        sb.append(SEPERATOR);
        sb.append(this.body);
        sb.append(SEPERATOR);
        sb.append(ArrayHelper.parseArrayToString(this.attachments));
        sb.append(SEPERATOR);
        sb.append(this.postedDate);
        sb.append(SEPERATOR);

        return sb.toString();
    }
}
